<template>
<div class="login ">
    <div class="logo">
      <img src="./assets/images/title-icon.png" alt="">
    </div>
    <div class="wel">
      <div class="text1">您好,</div>
      <div class="text2">欢迎来到两学一测</div>
    </div>
    <van-form @submit="onSubmit">
        <van-field
    v-model="username"
    maxlength="10"
    placeholder="请输入姓名"
    :rules="[{ required: true,message:'1235' }]"
            >
            <template #left-icon>
                    <i class="icon- cxj-iconrenwu"></i>
                </template>
        </van-field>
        <van-field
    v-model="password"
    maxlength="10"
    placeholder="请输入密码密码"
    :rules="[{ required: true,message:'1235'  }]"
          >
           <template #left-icon>
                    <i class="icon- cxj-iconanquanbaomiyuan"></i>
                </template>
        </van-field>
        <van-field
    v-model="phone"
    placeholder="请输入联系电话"
    :rules="[{ required: true,  }]"
        >
        <template #left-icon>
                    <i class="icon- cxj-iconshouji"></i>
                </template>
        </van-field>
        <van-field
        role="button"
    v-model="home"
    placeholder="请选择所属分县局"
    @click="showPiceker=true"
    :rules="[{ required: true, }]"
        >
        <template #left-icon>
                    <i class="icon- cxj-iconfangzi"></i>
        </template>
        <template #right-icon>
                    <i class="icon- cxj-iconarrow-down"></i>
        </template>
        </van-field>
      <div class="btn">
          <van-button round block type="info" native-type="submit">登录</van-button>
      </div>
    </van-form>
    <van-popup v-model="showPicker" round position="bottom">
            <van-cascader
                :options="deptList"
                :closeable="false"
                @change="onChange"
                active-color="#1989fa"
            >
            </van-cascader>
        </van-popup>
  </div>
</template>

<script>
// const axios = require('axios')
// import axios from 'axios'
export default {
  name: 'LoginPage',
  data () {
    return {
      showPicker: false,
      formData: {
        userName: '张三',
        policeCode: '06893254',
        lxdh: '13012341234',
        deptId: '150000000000',
        deptName: '内蒙古省厅'
      },
      deptList: [],
      selectDept: {}
    }
  },
  created () {
  },
  methods: {
    onSubmit (values) {
      console.log('submit', values)
    },
    onFinish ({ selectedOptions }) {
      this.show = false
      this.fieldValue = selectedOptions.map((option) => option.text).join('/')
    }
  }
}
</script>

<style lang="sass" src='./assets/css/index.sass'>

</style>
